/PROG  PNS0199
/ATTR
OWNER		= MNEDITOR;
COMMENT		= "PNS0016 SPM";
PROG_SIZE	= 3247;
CREATE		= DATE 12-07-18  TIME 19:57:52;
MODIFIED	= DATE 13-08-15  TIME 12:05:04;
FILE_NAME	= PNS0016;
VERSION		= 0;
LINE_COUNT	= 113;
MEMORY_SIZE	= 3739;
PROTECT		= READ_WRITE;
TCD:  STACK_SIZE	= 0,
      TASK_PRIORITY	= 50,
      TIME_SLICE	= 0,
      BUSY_LAMP_OFF	= 0,
      ABORT_REQUEST	= 0,
      PAUSE_REQUEST	= 0;
DEFAULT_GROUP	= 1,*,*,*,*;
CONTROL_CODE	= 00000000 00000000;
/APPL
/MN
   1:  !******************************** ;
   2:  !     COSMA METAL FORMING  ;
   3:  !******************************** ;
   4:  !  LINE: CHINA CHANGSHA ;
   5:  !  ROBOT: RL1 ;
   6:  !  PROGRAM: PNS0016 ;
   7:  !  PART:53122910  ;
   8:  !******************************** ;
   9:   ;
  10:  !INITIALIZE ;
  11:  MOVE TO HOME    ;
  12:  R[14]=90    ;
  13:  R[18]=1    ;
  14:  R[19]=.3    ;
  15:   ;
  16:  !------------------------------- ;
  17:  !BEGINNING OF PROGRAM ;
  18:  CALL PARTDROP    ;
  19:  COL GUARD ADJUST R[14] ;
  20:  UTOOL_NUM=1 ;
  21:  UFRAME_NUM=0 ;
  22:  PAYLOAD[1] ;
  23:   ;
  24:  !INITIATE TO PICK-POUNCE ;
  25:J P[1:MIDDLE] 50% CNT100 ACC150    ;
  26:J P[2:PICK POUNCE] 50% CNT100 ACC150 BREAK    ;
  27:   ;
  28:  R[1]=0    ;
  29:  TIMER[1]=RESET ;
  30:  TIMER[1]=START ;
  31:   ;
  32:  LBL[10:TOP OF LOOF] ;
  33:  OVERRIDE=R[5] ;
  34:   ;
  35:  TIMER[2]=STOP ;
  36:  R[1]=R[1]+1    ;
  37:  R[2]=TIMER[2]    ;
  38:  R[3]=60/R[2]    ;
  39:  TIMER[2]=RESET ;
  40:  TIMER[2]=START ;
  41:   ;
  42:  !PROCEED TO PICK ;
  43:  LBL[20] ;
  44:  IF DI[1]=ON AND DI[8]=ON,JMP LBL[25] ;
  45:  IF DI[29]=ON,JMP LBL[90] ;
  46:  JMP LBL[20] ;
  47:   ;
  48:  LBL[25] ;
  49:  OVERRIDE=R[5] ;
  50:J P[3:PICK APPROACH] 100% CNT100 ACC150    ;
  51:  DO[1]=OFF ;
  52:   ;
  53:J P[4:PICK ] 100% CNT0 TB R[18]sec,CALL PARTPICK ACC150 BREAK    ;
  54:  PAYLOAD[2] ;
  55:  CALL CHK_PICK    ;
  56:J P[5:PICK DEPART] 100% CNT100 ACC80    ;
  57:  CALL CHECK_PICK    ;
  58:  MONITOR Z_CHECH ;
  59:J P[6:PICK SNEAK] 100% CNT100 ACC150 DB  300.0mm,CALL END_PICK    ;
  60:  DO[1]=ON ;
  61:  DO[8]=PULSE,1.0sec ;
  62:J P[7:PICK CLEAR] 100% CNT100 ACC150    ;
  63:  CALL CHECK_PICK    ;
  64:  LBL[30:GOTO DROP POUNCE] ;
  65:J P[8:DROP POUNCE] 100% CNT100 ACC150 BREAK    ;
  66:  CALL CHECK_PICK    ;
  67:   ;
  68:  LBL[40:AT DROP POUNCE] ;
  69:  IF DI[2]=ON AND DI[4]=ON AND DI[5]=ON,JMP LBL[80] ;
  70:  IF DI[7]=ON AND DI[2]=ON,JMP LBL[50] ;
  71:  IF DI[18]=ON,JMP LBL[60] ;
  72:  JMP LBL[40] ;
  73:   ;
  74:  LBL[50:MOVE DROP SNEAK] ;
  75:  OVERRIDE=R[5] ;
  76:J P[9:DROP SNEAK] 100% CNT100 ACC150 BREAK    ;
  77:  LBL[51:DROP OR C-P-S] ;
  78:  IF DI[2]=ON AND DI[4]=ON AND DI[5]=ON,JMP LBL[80] ;
  79:  IF DI[18]=ON,JMP LBL[40] ;
  80:  JMP LBL[51] ;
  81:  JMP LBL[50] ;
  82:   ;
  83:  LBL[60:MOVE CLS-PRS-ACC] ;
  84:J P[1:MIDDLE] 50% CNT100 ACC100    ;
  85:  PAUSE ;
  86:  JMP LBL[40] ;
  87:   ;
  88:  LBL[80:DROP ENABLED] ;
  89:  !PROCEED TO DROP ;
  90:  DO[4]=OFF ;
  91:  OVERRIDE=R[5] ;
  92:J P[10:DROP APPROACH] 100% CNT50 ACC150    ;
  93:   ;
  94:J P[11:DROP] 100% CNT30 TB R[19]sec,CALL PARTDROP ACC100 BREAK    ;
  95:  DO[6]=PULSE,1.5sec ;
  96:  PAYLOAD[1] ;
  97:  CALL CHK_DROP    ;
  98:  DO[7]=PULSE,1.0sec ;
  99:J P[12:DROP DEPART] 100% CNT70 ACC150    ;
 100:J P[13:DROP CLEAR] 100% CNT100 ACC150    ;
 101:  WAIT   0.00(sec) ;
 102:  !GOTO PICK POUNCE ;
 103:J P[2:PICK POUNCE] 100% CNT100 ACC125 BREAK    ;
 104:  IF DI[29]=ON,JMP LBL[90] ;
 105:  JMP LBL[10] ;
 106:   ;
 107:  LBL[90:END OF CYCLE] ;
 108:  TIMER[1]=STOP ;
 109:  R[4]=TIMER[1]    ;
 110:J P[1:MIDDLE] 50% CNT100    ;
 111:  MOVE TO HOME    ;
 112:   ;
 113:  LBL[100:END OF PROGRAM] ;
/POS
P[1:"MIDDLE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2642.570  mm,	Y =   225.598  mm,	Z =  -556.779  mm,
	W =   179.995 deg,	P =     -.002 deg,	R =   -90.000 deg
};
P[2:"PICK POUNCE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2537.675  mm,	Y =   388.798  mm,	Z =  -920.000  mm,
	W =  -179.759 deg,	P =     -.248 deg,	R =   -90.004 deg
};
P[3:"PICK APPROACH"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2544.263  mm,	Y =   574.649  mm,	Z =  -928.613  mm,
	W =  -179.759 deg,	P =     -.248 deg,	R =   -90.004 deg
};
P[4:"PICK "]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2544.632  mm,	Y =   574.802  mm,	Z = -1053.136  mm,
	W =   179.956 deg,	P =     -.388 deg,	R =   -90.316 deg
};
P[5:"PICK DEPART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2544.622  mm,	Y =   574.840  mm,	Z =  -898.480  mm,
	W =  -179.811 deg,	P =     -.287 deg,	R =   -90.004 deg
};
P[6:"PICK SNEAK"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2680.000  mm,	Y =  -845.559  mm,	Z =  -800.000  mm,
	W =  -179.806 deg,	P =     -.644 deg,	R =   -89.995 deg
};
P[7:"PICK CLEAR"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2680.000  mm,	Y =  -939.346  mm,	Z =  -800.000  mm,
	W =  -179.731 deg,	P =     -.633 deg,	R =   -89.996 deg
};
P[8:"DROP POUNCE"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2702.730  mm,	Y = -1734.068  mm,	Z =  -800.032  mm,
	W =  -179.971 deg,	P =     -.218 deg,	R =   -90.002 deg
};
P[9:"DROP SNEAK"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2680.000  mm,	Y = -2713.795  mm,	Z =  -850.000  mm,
	W =  -179.265 deg,	P =     -.029 deg,	R =   -87.661 deg
};
P[10:"DROP APPROACH"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2633.807  mm,	Y = -3452.961  mm,	Z =  -930.000  mm,
	W =  -179.551 deg,	P =     -.936 deg,	R =   -87.716 deg
};
P[11:"DROP"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2633.808  mm,	Y = -3452.962  mm,	Z = -1040.000  mm,
	W =  -179.551 deg,	P =     -.936 deg,	R =   -87.716 deg
};
P[12:"DROP DEPART"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2633.807  mm,	Y = -3452.961  mm,	Z =  -930.000  mm,
	W =  -179.551 deg,	P =     -.936 deg,	R =   -87.716 deg
};
P[13:"DROP CLEAR"]{
   GP1:
	UF : 0, UT : 1,		CONFIG : 'N U T, 0, 0, 0',
	X =  2679.990  mm,	Y = -1733.283  mm,	Z =  -940.060  mm,
	W =   179.990 deg,	P =      .001 deg,	R =   -87.660 deg
};
/END
